<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>循环遍历数组</title>
</head>
<body>
    <div id="yun9">
       <ul>
           <!--遍历数组时，参数位至少传入一个参数表示当前遍历的对象，如果传入两个值，第一个值表示当前元素，第二个值表示当前元素的角标-->
           <li v-for="(ele,index) in arr" :key="index">
               {{index}}--{{ele}}
           </li>

           <li v-for="(user,index) in users" :key="index">
               {{index+1}}:{{user.id}}---{{user.name}}----{{user.age}}
           </li>
       </ul>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el:"#yun9",
            data:{
                arr:[1,2,9,63,5,8],
                users:[
                    {
                        id:10081,
                        name:"ldh1",
                        age:50,
                        birth:"2018-08-08"
                    },
                    {
                        id:10082,
                        name:"ldh1",
                        age:50,
                        birth:"2018-08-08"
                    },{
                        id:10083,
                        name:"ldh1",
                        age:50,
                        birth:"2018-08-08"
                    },
                    {
                        id:10084,
                        name:"ldh1",
                        age:50,
                        birth:"2018-08-08"
                    },{
                        id:10085,
                        name:"ldh1",
                        age:50,
                        birth:"2018-08-08"
                    }
                ]
            }

        });
    </script>
</body>
</html>